<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!-- Form to allow a guest to register into the system -->
<ui:composition template="/templates/master_template.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:p="http://primefaces.org/ui"
    xmlns:f="http://xmlns.jcp.org/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets">
    
    <ui:define name="title">Registration</ui:define>

    <ui:define name="content">
        
        
        <p:panel id="registration_container">
            
            <h1>Register</h1>
            
            <h:form id="registration_form">

                <p:growl id="growl" showDetail="true" showSummary="false" autoUpdate="true" redisplay="true"/>
                    
                <h:panelGrid columns="2" id="registration_grid" styleClass="table_no_border">

                    <h:outputLabel for="firstName">First Name:</h:outputLabel>
                    <p:inputText id="firstName" value="#{registrationBean.user.firstName}">
                        <p:ajax update="growl"/>
                    </p:inputText>
                    <!--<p:message id="firstNameMsg" for="firstName"/>-->

                    <h:outputLabel for="lastName">Last Name:</h:outputLabel>
                    <p:inputText id="lastName" value="#{registrationBean.user.lastName}">
                        <p:ajax update="growl"/>
                    </p:inputText>
                    <!--<p:message id="lastNameMsg" for="lastName"/>-->

                    <h:outputLabel for="email">Email:</h:outputLabel>
                    <p:inputText id="email" value="#{registrationBean.user.email}" >
                        <p:ajax update="growl"/>
                    </p:inputText>
                    <!--<p:message id="emailMsg" for="email" />-->

                    <h:outputLabel for="password">Password:</h:outputLabel>
                    <p:password id="password" value="#{registrationBean.user.password}" feedback="true" match="confirmPassword" label="Password"/>
                    <!--<p:message for="password" />-->

                    <h:outputLabel for="confirmPassword">Confirm Password:</h:outputLabel>
                    <p:password id="confirmPassword" label="Confirm Password"/>

                </h:panelGrid>

                <p:commandButton styleClass="login_button" value="Confirm" update="registration_grid growl" action="#{registrationBean.register()}"/>

             </h:form>
        </p:panel>

    </ui:define>
</ui:composition>